package com.kitten.auth.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum LoginTypeEnum {
    // 验证码登录
    VERIFICATION_CODE(1),
    // 账密登录
    PASSWORD(2);


    private final Integer typeCode;

    public static LoginTypeEnum getType(Integer typeCode) {
        for (LoginTypeEnum loginType : LoginTypeEnum.values()) {
            if (Objects.equals(loginType.getTypeCode(), typeCode)) {
                return loginType;
            }
        }
        return null;
    }
}
